package com.example.demo.services.impl;

import com.example.demo.dao.GLYRepository;
import com.example.demo.entity.GLY;
import com.example.demo.services.GLYService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GLYServiceImpl implements GLYService {

    @Autowired
    private GLYRepository glyRepository;

    /**
     * @Author: Ding XiJie
     * @Description: 添加管理员
     */
    @Override
    public GLY save(GLY gly) {
        gly = glyRepository.save(gly);
        return gly;
    }

    /**
     * @Author: Ding XiJie
     * @Description: 修改管理员
     */
    @Override
    public GLY update(GLY gly) {
        return glyRepository.save(gly);
    }

    /**
     * @Author: Ding XiJie
     * @Description: 删除管理员
     */
    @Override
    public void delete(int id) {
        glyRepository.deleteById(id);
    }
}
